package com.charlotte.study.gupao.flyweight.ticket;

import java.util.Random;

/**
 * @author junjie.ding
 * @date 2020/3/10
 */
public class TrainTicket implements ITicket {

    private String from;

    private String to;

    private double price;

    public TrainTicket(String from, String to) {
        this.from = from;
        this.to = to;
    }

    @Override
    public void showInfo(String bunk) {
        this.price = new Random().nextInt(500);
        System.out.println(from + " -> " + to + " : " + price);
    }
}
